<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>JWWUI Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="jww/themes/icon.css" />
<link rel="stylesheet" type="text/css"
	href="jww/themes/default/jww.min.css" />
<link rel="stylesheet" type="text/css" href="/common.css" />
<script type="text/javascript" src="jww/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="jww/json2.js"></script>
<script type="text/javascript" src="jww/jww.min.js"></script>
<script type="text/javascript" src="jww/locale/jww-lang-zh_CN.js"></script>
</head>
<body>
	<div data-type="layout" data-defs="fit:true">
		<div data-defs="region:'north',border:false"
			style="height: 69px; padding: 0px;">
			<table width="100%" class="headbg">
				<tr>
					<td width="50%" class="headleftbg"></td>
					<td width="25%" align="right"><span style="color: #666633"><b>您好,&nbsp;XXX</b></span>
					</td>
					<td width="35%">
						<div style="padding-top: 36px; padding-right: 1px; height: 100%; width: 100%">
							<a href="#" onclick="changeTheme('default')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-d'"></a>
							<a href="#" onclick="changeTheme('lightness')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-l'"></a>
							<a href="#" onclick="changeTheme('start')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-s'"></a>
							<a href="#" onclick="changeTheme('start2')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-g'"></a>
							<a href="#" onclick="changeTheme('pepperGrinder')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-p'"></a>
						</div>
					</td>
				</tr>
			</table>
		</div>
		<div
			data-defs="region:'west',split:true,border:false,headerType:'accordion'"
			title="菜单信息" style="width: 230px;">
			<div data-type="accordion" data-defs="fit:true,border:true">
				<div title="组件演示" data-defs="selected:false">
					<ul id="nativeDemoTree2" data-type="tree" style="padding: 0px"
						data-defs="
				method:'get',
				onClick : tree2OnClickFun,
				url:'demo/testdata/index2.json',
				animate:false,dnd:false"></ul>
				</div>
				<div title="API" data-defs="selected:false">
					<ul id="nativeDemoTree3" data-type="tree" style="padding: 0px"
						data-defs="
				method:'get',
				onClick : tree3OnClickFun,
				url:'demo/testdata/index_api.json',
				animate:false,dnd:false"></ul>
				</div>
			</div>
		</div>
		<div data-defs="region:'south',split:true,border:true,bodyCls:'byb byt byl byr'"
			style="height: 50px; padding: 10px;">ccc</div>
		<div data-defs="region:'center',title:'',border:true,headerType:'layout',bodyCls:'byb byt byl byr'"
			style="padding: 0px;">
			<div id="bsTabs" data-type="tabs"
				data-defs="fit:true,plain:false,border:false,headerCls:'byb'">
				<div title="欢迎页面" style="padding: 10px;"
					href="/jwwui/jww/jwwui.html"></div>
				<div title="软件协议" style="padding: 10px;"
					href="/jwwui/jww/gpl.html"></div>
				<div title="更新历史" style="padding: 10px;"
					href="/jwwui/jww/history.html"></div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		var webRoot = "${rc.contextPath}";
		function addTab(title, href, icon) {
			var tt = $('#bsTabs');
			if (tt.tabs('exists', title)) {
				tt.tabs('select', title);
				var tab = $('#bsTabs').tabs('getSelected');
				if (tab) {
					var index = $('#bsTabs').tabs('getTabIndex', tab);
					$('#bsTabs').tabs('close', index);
				}
			}
			var content = "";
			if (href) {
				tt.tabs('add', {
					title : title,
					closable : true,
					href : href,
					iconCls : icon || 'icon-default'
				});
			} else {
				tt.tabs('add', {
					title : title,
					closable : true,
					content : "请输入请求地址!",
					iconCls : icon || 'icon-default'
				});
			}
		}
		function tree1OnClickFun(node) {
			if (node.attributes) {
				addTab(node.text, node.attributes.url, '');
			}
		}
		function tree2OnClickFun(node) {
			if (node.attributes) {
				//ajaxLoading();
				addTab(node.text, "demo\\" + node.attributes.url, '');
			}
		}
		function tree3OnClickFun(node) {
			if (node.attributes) {
				//ajaxLoading();
				addTab(node.text, node.attributes.url, '');
			}
		}
		function changeTheme(themeId) {
			if (themeId == null || themeId == "") {
				return;
			}
			var links = $("LINK");
			// for ( var i = 2; i < links.length; i++) {
			for (var i = 1; i < links.length; i++) {
				var h = $(links[i]).attr("href");
				var hh = h.split("themes");
				var root = hh[0];
				var ls = hh[1];
				var theme = ls.split("/")[1];
				var plug = ls.split("/")[2];
				var v = root + "themes/" + themeId + "/" + plug;
				$(links[i]).attr("href", v);
			}
		}
	</script>
</body>
</html>